package com.shareyi.baseproject.kernel.domain.common.entity;


import com.shareyi.baseproject.kernel.common.valid.Validate;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * 租户id值对象
 *
 * @author david
 * @date 2021-06-23
 */
@Getter
@ToString
@AllArgsConstructor
public class TenantIdentifier {

    /**
     * 租户id，String
     */
    protected String tenantId;

    public static TenantIdentifier of(String tenantId) {
        Validate.notNull(tenantId, "租户id不能为空");
        return new TenantIdentifier(tenantId);
    }


    public Long getTenantIdLong() {
        return Long.valueOf(tenantId);
    }
}
